package cn.dgfy.ssm.pojo.helper;

import cn.dgfy.ssm.dto.UserDto;
import cn.dgfy.ssm.pojo.User;
import cn.dgfy.ssm.util.IPHelper;


public class UserHelper {
	public static UserDto toUserDto(User user) {
		UserDto userDto = new UserDto();
		
		userDto.setId(user.getId());
		userDto.setUsername(user.getUsername());
		userDto.setAdmin(user.getAdmin());
		userDto.setLastDate(user.getLastDate());
		userDto.setLastIP(IPHelper.getIPStringFromLongFormat(user.getLastIP()));
		userDto.setMemo(user.getMemo());
		
		return userDto;
	}
}
